package com.tongji.housediy.controller.goodsCMD
{
	import com.tongji.housediy.events.goodsEvent.FilterGoodsEvent;
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.model.GoodsModel;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenchao
	 * 
	 */
	public class FilterGoodsCommand extends Command
	{
		[Inject]
		public var goodsModel:GoodsModel;
		
		[Inject]
		public var event:FilterGoodsEvent;
		
		[Inject]
		public var brandModel:BrandModel;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case "filterGoods":
					goodsModel.filterArrayCollection(event.id, event.selectedIndexArray);
					break;
				case "filterBrand":
					brandModel.filterArrayCollection(event.id, event.selectedIndexArray);
					break;
			}
		}
	}
}